<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="../head.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>order-list</title>

	<script type="javascript">

        function optDelete(id,orderState,pageNo){
            //请至少选择一个
            var size = $("input[name=ids]:checked").size();
            if(size == 0){
                alert("请至少选择一个");
                return ;
            }
            //你确定删除吗？
            if(!confirm("你确定删除吗？")){
                return;
            }
            $("#jvForm").attr("action","/order/deletes.do?id=" + id + "&amp;orderState=" + orderState + "&amp;pageNo=" + pageNo);
            $("#jvForm").attr("method","post").submit();

        }
	</script>
</head>
<body>
<div class="box-positon">
	<div class="rpos">当前位置: 订单管理 - 列表</div>
	<div class="clear"></div>
	<form class="ropt">
		<input class="add" type="button" value="添加" onclick="window.location.href='/order/toAdd.do'"/>
	</form>
</div>
<div class="body-box">
<input type="hidden" name="pageNo" value="${pageNo}"/>
<form method="post" id="tableForm">
<input type="hidden" value="" name="pageNo"/>
<input type="hidden" value="" name="queryName"/><form action="/order/list.do" method="post" style="padding-top:5px;">
		订单编号: <input type="text" name="id" value="${id}"/>
		<select name="paymentWay">
				<option value="" <c:if test="${paymentWay == null}">selected="selected" </c:if> >---付款方式---</option>
				<option value="1" <c:if test="${paymentWay == 1}">selected="selected" </c:if> >平台付款</option>
				<option value="0" <c:if test="${paymentWay == 0}">selected="selected" </c:if> >货到付款</option>
		</select>
		</select>
		<select name="isPay">
			<option value="" <c:if test="${isPay == null}">selected="selected" </c:if> >---付款状态---</option>
			<option value="1" <c:if test="${isPay == 1}">selected="selected" </c:if> >已付款</option>
			<option value="0" <c:if test="${isPay == 0}">selected="selected" </c:if> >待付款</option>
		</select>
		<select name="orderState">
			<option value="" <c:if test="${orderState == null}">selected="selected" </c:if> >---订单状态---</option>
			<option value="1" <c:if test="${orderState == 1}">selected="selected" </c:if> >有效订单</option>
			<option value="0" <c:if test="${orderState == 0}">selected="selected" </c:if> >失效订单</option>
		</select>
	<input type="submit" class="query" value="查询"/>
</form>
<table cellspacing="1" cellpadding="0" border="0" width="100%" class="pn-ltable">
	<thead class="pn-lthead">
		<tr>
			<th width="20"><input type="checkbox" onclick="Pn.checkbox('ids',this.checked)"/></th>
			<th>订单号</th>
			<th>订单金额</th>
			<th>运费</th>
			<th>应付金额</th>
			<th>支付方式</th>
			<th>支付状态</th>
			<th>订单状态</th>
			<th>下单时间</th>
			<th>用户id</th>
			<th>备注</th>
			<th>操作选项</th>
		</tr>
	</thead>
	<tbody class="pn-ltbody">
	<c:forEach items="${pagination.list}" var="order">
		<tr bgcolor="#ffffff" onmouseover="this.bgColor='#eeeeee'" onmouseout="this.bgColor='#ffffff'">
			<td><input type="checkbox" name="ids" value="${order.id}"/></td>
			<td align="center">${order.id}</td>
			<td align="center">${order.orderPrice}</td>
			<td align="center">${order.freight}</td>
			<td align="center">${order.amountPay}</td>
			<td align="center">
				<c:if test="${order.paymentWay==1}">平台付款</c:if>
				<c:if test="${order.paymentWay==0}">货到付款</c:if>
			</td>
			<td align="center">
				<c:if test="${order.isPay==1}">已付款</c:if>
				<c:if test="${order.isPay==0}">待付款</c:if>
			</td>

			<td align="center">
				<c:if test="${order.orderState==1}">有效订单</c:if>
				<c:if test="${order.orderState==0}">失效订单</c:if>
			</td>
			<td align="center">${order.createDate}</td>
			<td align="center">${order.userId}</td>
			<td align="center"></td>
			<td align="center">
				<%--<a href="/order/view.do?id=${order.id}&pageNo=${pagination.pageNo}" class="pn-opt">查看</a>--%>
				<a href="/order/view.do?id=${order.id}&pageNo=${pagination.pageNo}" class="pn-opt">查看</a>

				<a href="/order/toEdit.do?id=${order.id}&pageNo=${pagination.pageNo}" class="pn-opt">修改</a>
				<a class="pn-opt" onclick="if(!confirm('您确定删除吗？')) {return false;}" href="/order/delete.do?id=${order.id}&pageNo=${pagination.pageNo}">删除</a>
			</td>
		</tr>
	</c:forEach>
	</tbody>
</table>
	<div class="page pb15">
	<span class="r inb_a page_b">
		<c:forEach items="${pagination.pageView}" var="page">
			${page}
		</c:forEach>
	</span>
	</div>
	<%--<div style="margin-top:15px;"><input class="del-button" type="button" value="删除" onclick="optDelete('${id}','${orderState}','${pagination.pageNo}');"/></div>--%>
<div style="margin-top:15px;">
<!-- 	<input class="del-button" type="button" value="取消" onclick="optCancel();"/>
	<input class="submit" type="button" value="通过" onclick="optPass();"/> -->
</div>
</form>
</div>
</body>
</html>